<!DOCTYPE html>
<title>Crash updating a CSS animation after setting its effect to null</title>

<style>
@keyframes anim {
  from {
    margin-left: 0px;
  }
  to {
    margin-left: 100px;
  }
}
</style>

<div id="box" style="width:100px; height: 100px; background: black; animation: anim 1s"></div>
<p>This should not crash</p>

<script>
if (window.testRunner)
  testRunner.dumpAsText();

const animation = box.getAnimations()[0];
animation.effect = null;
// Cause an update of the CSS animation by changing the duration.
box.style.animationDuration = "2s";
</script>
